package com.itheima.health.job;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.service.OrderSettingService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 包名：com.itfish.health.job
 *
 * @author zy
 * @date 2020 -09-04 9:47
 */
public class CleanOrderSettingJob {

    @Reference
    private OrderSettingService orderSettingService;

    public void cleanOrderSetting(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String nowDate = sdf.format(new Date());

        orderSettingService.deleteByDate(nowDate);
        System.out.println("图片清理完成");
    }
}
